package com.studyroom.controller;

import com.studyroom.common.Result;
import com.studyroom.entity.Snack;
import com.studyroom.service.SnackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/snacks")
public class AppSnackController {

    @Autowired
    private SnackService snackService;

    @GetMapping
    public Result<List<Snack>> list() {
        return Result.success(snackService.getAvailableSnacks());
    }
} 